import numpy as np
import cv2

if __name__ == '__main__':
    img = cv2.imread('3/lena_gray.jpg')
    # mask = np.ones(img.shape, dtype=np.uint8) * 128
    mask1 = np.ones(img.shape, dtype=np.uint8)
    # img = cv2.bitwise_and(img, mask)
    img1 = cv2.bitwise_and(img, mask1)
    # cv2.imshow('img', img)
    # cv2.imshow('img1', img1)
    # cv2.waitKey(0)
    # cv2.destroyAllWindows()
    # print(img)

    img3 = np.ones(img.shape, dtype=np.uint8)
    img3 = np.copy(img1)
    img3[img3 > 0] = 255
    cv2.imshow('img3', img3)
    cv2.waitKey(0)
    cv2.destroyAllWindows()